<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .wrap {
    width: 100px;
    height: 120px;
    border: 1px solid #999;
  }

  .wrap-list {
    display: flex;
    justify-content: center;
  }
</style>

<body>
  <!-- <div class="wrap">
    <div class="wrap-list">*</div>
    <div class="wrap-list">***</div>
    <div class="wrap-list">*****</div>
    <div class="wrap-list">*******</div>
    <div class="wrap-list">*********</div>
  </div> -->
  <script>
    // 三元运算符比较最大值
    var a = 19;
    var b = 28;
    var c = a >= b ? '19大于28' : '19小于28';
    document.write(c + '</br>');

    /* 输出【100-999】中的水仙花数
     *水仙花数是指一个3位数，它的每个位上的数字的3次幂之和等于它本身，例如：1^3+5^3+3^3=153。
    */
    for (var i = 100; i <= 999; i++) {
      var hunder = parseInt(i / 100);
      var decade = parseInt((i % 100) / 10);
      var unit = i % 10;
      if (hunder ** 3 + decade ** 3 + unit ** 3 == i) {
        document.write(i + '、');
      }

    }

    document.write('</br>');


    //  打印金字塔
    document.write('<div class="wrap">');
    for (var row = 1; row <= 5; row++) {
      document.write('<div class="wrap-list">');
      for (var j = 1; j <= 2 * row - 1; j++) {
        document.write('*');
      }
      document.write('</div>');
    }
    document.write('</div>');
  </script>
</body>

</html>